import IOC.Bean2;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by futao on 2017/8/30.
 */

/**
 * 用静态工厂创建bean
 */
public class TestBean2 {
    @Test
    public void testStaticFactory() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        Bean2 bean2 = (Bean2) applicationContext.getBean("bean2");
        System.out.println(bean2);
        bean2.add();
    }

}
